<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%@ page isELIgnored="false"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>山西煤炭现货公路交易系统客户端</title>
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.5 -->
<link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/bootstrap/css/bootstrap.min.css">
<!-- 日期范围-->
<link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/plugins/daterangepicker/daterangepicker-bs3.1.css">
<script src="<s:url value="/resources"/>/adminlte/plugins/jQuery/jQuery-2.1.4.min.js"></script>
<script src="<s:url value="/resources"/>/adminlte/bootstrap/js/bootstrap.min.js"></script>
<script src="<s:url value="/resources"/>/adminlte/plugins/daterangepicker/moment2.9.0.js"></script>
<script src="<s:url value="/resources"/>/adminlte/plugins/daterangepicker/daterangepicker1.3.6.js"></script>
<!-- 日期范围-->	
<!-- Ionicons -->
<link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/ionicons/css/ionicons.min.css">
<!-- jvectormap -->
<link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/plugins/jvectormap/jquery-jvectormap-1.2.2.css">
<!-- Theme style -->
<link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/dist/css/AdminLTE.min.css">
<link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/dist/css/skins/_all-skins.min.css">
<!-- DataTables -->
<link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/plugins/datatables/dataTables.bootstrap.css">
<!-- AdminLTE Skins. Choose a skin from the css/skins
     folder instead of downloading all of them to reduce the load. -->
<link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/dist/css/skins/_all-skins.min.css">
<!-- 2016.8.19查询加样式 -->
<link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/css/custom.css">

<!-- AdminLTE App -->
<script src="<s:url value="/resources"/>/adminlte/dist/js/app.min.js"></script>
<!-- Select2 -->
<link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/plugins/select2/select2.css">
<!-- Theme style -->
<link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/dist/css/AdminLTE.min.css">
<!-- DataTables -->
<script src="<s:url value="/resources"/>/adminlte/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="<s:url value="/resources"/>/adminlte/plugins/datatables/dataTables.bootstrap.min.js"></script>
<!-- Select2 -->
<script src="<s:url value="/resources"/>/adminlte/plugins/select2/select2.full.min.js"></script>
<script src="<s:url value="/resources"/>/adminlte/plugins/select2/i18n/zh-CN.js"></script>
<script src="<s:url value="/resources"/>/adminlte/default.js"></script>
<script src="<s:url value="/resources"/>/adminlte/default_logistical.js"></script>

<script src="<s:url value="/resources"/>/adminlte/My97DatePicker/WdatePicker.js"></script>

<script type="text/javascript">
$(function(){
	 dataTab("dataTab",false,false,false,true,true,false,"<s:url value="/resources"/>/adminlte/dataTabBootstrapCN.json");
	 loadMenu("${user.roleType}","${menuid}",${menuList});
	 getSelOpts("<s:url value="/"/>/logistical/getSelOpts","selFaj","fajs","province");//发运站点
	 $(".select2").select2();
});
function clickSum(type){
	document.getElementById("type").value=type;
	
	if(validateDay("2")){
		document.getElementById("form").submit();
	}else{
		return false;
	}
}
</script>
</head>
<body class="skin-blue sidebar-mini">
<input type="hidden" id="activeValue" name="activeValue"/>
<div class="wrapper">
<%@ include file="../../header.jsp" %>
<%@ include file="../../sidebar.jsp" %>
<div class="content-wrapper">
<form id="form" action="<s:url value="/"/>/logistical/provinceAnalysis?searchFlg=1" method="post">
        <div class="content-header">
          <h1>物流分析<small>山西省各路局综合分析</small></h1>
          <ol class="breadcrumb">
            <li><a href="<s:url value="/"/>/index.jsp"><i class="fa fa-dashboard"></i>首页</a></li>
            <li><a href="#" id="location1"></a></li>
          <li class="active" id="location2"></li>
          </ol>
        </div>
         <!-- 8.23 物流查询新页面 开始 -->
        <!-- Main content-->
        <div class="content">
          <div class="box  box-default">
	        <input type="hidden" value='${searchFlg}' name="searchFlg" id ="searchFlg"/>
	        <input type="hidden" value='${selFaj}' name="selFaj" id ="selFaj"/>
	        <input type="hidden" value='${type}' name="type" id ="type"/>
	        
              <div class="box-body">
                <h4>选择发运路局，再选择相应的分析内容</h4>
                <div class="row"><!-- /.col -->
	                <div class="col-md-25 col-md-20">
	                     <div class="form-group">
	                       <select id="fajs" name="fajs" class="form-control select2" data-placeholder="请选择发运路局" style="width:220px;height:25px;" >
			                  	</select>
	                     </div>
	                  </div>
                </div>
                <h4>选择分析内容</h4>
                <div class="wuliu_search_head">
                <button class="btn btn-primary"  type="button" onclick="clickSum('daoj');">到局分析</button>
                <button class="btn btn-primary"  type="button" onclick="clickSum('daoddq');">到达地区分析</button>
                <button class="btn btn-primary"  type="button" onclick="clickSum('hangy');">行业分析</button>
                <button class="btn btn-primary"  type="button" onclick="clickSum('gangk');">到达港口分析</button>
                <button class="btn btn-primary"  type="button" onclick="clickSum('shipArea');">发运地区分析</button>
                
                </div>
            </div>
          </div>
          <!-- /.box -->
          <div class="box  box-default">
              <div class="box-body">
                <h4>${titleStr}报表（默认显示当月，车数以辆为单位，吨数以万吨为单位）</h4>
                <div class="hd pd">
                <input type="hidden" value='${timeFlg}' name="timeFlg" id ="timeFlg"/>
                    <div class="gui-filter" id="quickTimeDiv">
                        <span class="tit">时间：</span>
                        <c:choose>
                        	<c:when test="${timeFlg eq 'year'}">
		                        <a href="javascript:" onclick="changTime(this);" class="current"  id="year">最近一年</a>
		                        <a href="javascript:" onclick="changTime(this);" id="threeMonth">最近一季度</a>
		                        <a href="javascript:" onclick="changTime(this);" id="month">最近一月</a>
                        	</c:when>
                        	<c:when test="${timeFlg eq 'threeMonth'}">
		                        <a href="javascript:" onclick="changTime(this);" id="year">最近一年</a>
		                        <a href="javascript:" onclick="changTime(this);" class="current" id="threeMonth">最近一季度</a>
		                        <a href="javascript:" onclick="changTime(this);" id="month">最近一月</a>
                        	</c:when>
                        	<c:when test="${timeFlg eq 'month'}">
		                        <a href="javascript:" onclick="changTime(this);" id="year">最近一年</a>
		                        <a href="javascript:" onclick="changTime(this);" id="threeMonth">最近一季度</a>
		                        <a href="javascript:" onclick="changTime(this);" class="current"  id="month">最近一月</a>
                        	</c:when>
                        	<c:otherwise>
                        		<a href="javascript:" onclick="changTime(this);"  id="year">最近一年</a>
		                        <a href="javascript:" onclick="changTime(this);"  id="threeMonth">最近一季度</a>
		                        <a href="javascript:" onclick="changTime(this);"  id="month">最近一月</a>
							</c:otherwise>
                        </c:choose>
                    </div>
                  <div class="gui-toolbar">
                       <input type="text" style="width:100px;padding-left: 17px;height: 32px;border: 1px solid #d2d6de;"  class="" id="startDate" name="startDate" value="${startDate}"  onfocus="WdatePicker({dateFmt:'yyyy-MM'})">
                      &nbsp;&nbsp;--&nbsp;&nbsp;<input type="text" style="width:30%;;padding-left: 27px;height: 32px;border: 1px solid #d2d6de;" class="" id="endDate" name="endDate" value="${endDate}"  onfocus="WdatePicker({dateFmt:'yyyy-MM'})"> 
                    </div>
                    <script type="text/javascript">
                    $(function(){
			           	  $('#reservation').daterangepicker(null, function(start, end, label) {
			           		  document.getElementById("timeFlg").value="0";
			           		  submit("form");
		                     //console.log(start.toISOString(), end.toISOString(), label);
		                  });
		              });
                    function changTime(obj){
                    	var subNav_active = $(".current");
                    	subNav_active.removeClass("current");
                   		obj.className="current";
                   		document.getElementById("timeFlg").value=obj.id;
                   		document.getElementById("startDate").value="";
                   		document.getElementById("endDate").value="";
                    	if(document.getElementById("type").value==""){
                    		alert("请选择分析内容！");
                    		return;
                    	}
                   		document.getElementById("form").submit();
                    }
               </script>
                </div>
                
              </div>
              <div class="box-body">
                 <table id="dataTab"  class="table table-bordered table-hover">
	                  <c:if test="${disFlg eq '0'}">
	                  	<thead>
		                    <c:forEach items="${tabSumList}" var="li">
		                      	 <tr>
		                        	<th>总计</th>
		                        	<th>${li.xuqcs}</th>
		                        	<th>${li.xuqds}</th>
		                        	<th>${li.shoulcs}</th>
		                        	<th>${li.shoulds}</th>
		                        	<th>${li.wanccs}</th>
		                        	<th>${li.wancds}</th>
		                        	<th></th>
		                        	<th></th>
		                        </tr>
		                      </c:forEach>
		                      <tr>
		                        <th>${lineOne}</th>
		                        <th>需求车数</th>
		                        <th>需求吨数</th>
		                        <th>受理车数</th>
		                        <th>受理吨数</th>
		                        <th>完成车数</th>
		                        <th>完成吨数</th>
		                        <th>完成车数同比</th>
		                        <th>完成车数环比</th>
		                      </tr>
                    	</thead>
                    	<tbody>
	                      <c:forEach items="${tablist}" var="li">
	                      	 <tr>
	                        	<td>${li.typename}</td>
	                        	<td>${li.xuqcs}</td>
	                        	<td>${li.xuqds}</td>
	                        	<td>${li.shoulcs}</td>
	                        	<td>${li.shoulds}</td>
	                        	<td>${li.wanccs}</td>
	                        	<td>${li.wancds}</td>
	                        	<td>
	                        	<c:if test="${li.tb lt 0.00}">
		                        		<font color="green">${li.tb}%</font>
		                        	</c:if>
		                        	<c:if test="${li.tb ge 0.00}">
		                        		<font color="red">${li.tb}%</font>
		                        	</c:if>
		                        </td>
		                        <td>
		                        	<c:if test="${li.hb lt 0.00}">
		                        		<font color="green">${li.hb}%</font>
		                        	</c:if>
		                        	<c:if test="${li.hb ge 0.00}">
		                        		<font color="red">${li.hb}%</font>
		                        	</c:if>
		                        	<c:if test="${li.hb eq null}">
		                        		<font color="red"></font>
		                        	</c:if>
		                        	</td>
	                        </tr>
	                      </c:forEach>
                    	</tbody>
	                  </c:if>
	                  <c:if test="${disFlg eq '1'}">
		                  	<thead>
			                    <c:forEach items="${tabSumList}" var="li">
			                      	 <tr>
			                        	<th>合计</th>
			                        	<th>${li.xuqcs}</th>
			                        	<th></th>
			                        	<th>${li.xuqds}</th>
			                        	<th></th>
			                        	<th>${li.shoulcs}</th>
			                        	<th></th>
			                        	<th>${li.shoulds}</th>
			                        	<th></th>
			                        	<th>${li.wanccs}</th>
			                        	<th></th>
			                        	<th>${li.wancds}</th>
			                        	<th></th>
			                        	<th></th>
			                        	<th></th>
			                        	<th></th>
			                        </tr>
			                      </c:forEach>
			                      <tr>
			                        <th>${lineOne}</th>
			                        <th>需求车数</th>
			                        <th>需求车数占比</th>
			                        <th>需求吨数</th>
			                        <th>需求吨数占比</th>
			                        <th>受理车数</th>
			                        <th>受理车数占比</th>
			                        <th>受理吨数</th>
			                        <th>受理吨数占比</th>
			                        <th>完成车数</th>
			                        <th>完成车数占比</th>
			                        <th>完成吨数</th>
			                        <th>完成吨数占比	</th>
			                        <th>兑现率</th>
			                        <th>完成车数同比</th>
		                            <th>完成车数环比</th>
			                      </tr>
	                    	</thead>
		                    <tbody>
		                      <c:forEach items="${tablist}" var="li">
		                      	 <tr>
		                        	<td>${li.typename}</td>
		                        	<td>${li.xuqcs}</td>
		                        	<td>${li.xuqcszb}%</td>
		                        	<td>${li.xuqds}</td>
		                        	<td>${li.xuqdszb}%</td>
		                        	<td>${li.shoulcs}</td>
		                        	<td>${li.shoulcszb}%</td>
		                        	<td>${li.shoulds}</td>
		                        	<td>${li.shouldszb}%</td>
		                        	<td>${li.wanccs}</td>
		                        	<td>${li.wanccszb}%</td>
		                        	<td>${li.wancds}</td>
		                        	<td>${li.wancdszb}%</td>
		                        	<td>${li.duixl}</td>
		                        	<c:if test="${li.tb lt 0.00}">
		                        		<td><font color="green">${li.tb}%</font></td>
		                        	</c:if>
		                        	<c:if test="${li.tb ge 0.00}">
		                        		<td><font color="red">${li.tb}%</font></td>
		                        	</c:if>
		                        	<c:if test="${li.hb lt 0.00}">
		                        		<td><font color="green">${li.hb}%</font></td>
		                        	</c:if>
		                        	<c:if test="${li.hb ge 0.00}">
		                        		<td><font color="red">${li.hb}%</font></td>
		                        	</c:if>
		                        </tr>
		                      </c:forEach>
		                    </tbody>
	                  </c:if>
                  </table>
              </div>
           </div>
        </div>
  </form>
  </div>
</div> 

 
</body>
</html>
